let EventEmitter = require('./src/index');
//let EventEmitter = require('events');

const util = require('util');

// console.log(util)
function Bell() {
    // 继承私有属性
    EventEmitter.call(this);
}

// 继承公用的方法
util.inherits(Bell,EventEmitter);

let bell = new Bell();

function sudentInClassroom(num,time) {
    console.log('学生'+ time +'进'+ num +'教室')
}
function teacherInClassroom(num,time) {
    console.log('教师'+ time +'进'+ num +'教室')
}
function masterInClassroom(num,time) {
    console.log('老王'+ time +'进'+ num +'教室')
}
bell.setMaxListeners(10)
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',sudentInClassroom);
bell.on('ring',teacherInClassroom);
bell.once('ring',masterInClassroom);

bell.emit('ring','502','准时')

